//  用来定位 cover-popup 的层级
import { ref } from 'vue';

const curLevel = ref(1000);

function addLevel() {
    return ++curLevel.value;
}

function subLevel() {
    if (curLevel.value <= 1000) return;
    return --curLevel.value;
}

export function useCoverPopup() {
    return [ curLevel, addLevel, subLevel ];
}


const show = ref(false);
function showCoverPopup() {
    show.value = true;
}

function hideCoverPopup() {
    if (curLevel.value > 1000) return;
    show.value = false;
}

export function useCoverPopupShow() {
    return [ show, showCoverPopup, hideCoverPopup ];
}
